<<<<<<< HEAD
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/25
 * Time: 10:41
 */

namespace app\index\model;


class Product extends Base
{
    protected $table = 'sy_product';

    public function getUrlAttr($value)
    {
        return config('url.QiNiuUrl') . '/' . $value;
    }


    public function img()
    {
        return $this->belongsTo('Image', 'img_id', 'id');
    }

    public function category()
    {
        return $this->belongsTo('Category', 'category_id', 'id');
    }

    public function theme()
    {
        return $this->belongsToMany('Theme', 'sy_theme_product', 'theme_id', 'product_id');
    }

    public function productInfo()
    {
        return $this->hasMany('ProductInfo', 'product_id', 'id');
    }
    
=======
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/25
 * Time: 10:41
 */

namespace app\index\model;


class Product extends Base
{
    protected $table = 'sy_product';

    public function getUrlAttr($value)
    {
        return config('url.QiNiuUrl') . '/' . $value;
    }


    public function img()
    {
        return $this->belongsTo('Image', 'img_id', 'id');
    }

    public function category()
    {
        return $this->belongsTo('Category', 'category_id', 'id');
    }

    public function theme()
    {
        return $this->belongsToMany('Theme', 'sy_theme_product', 'theme_id', 'product_id');
    }

    public function productInfo()
    {
        return $this->hasMany('ProductInfo', 'product_id', 'id');
    }
    
>>>>>>> 93c40d8086b7a8d5a9aa3548fdc8eb06a4272cf7
}